package inheritance;

public class TestCylinder {
    private double radius;

    public TestCylinder(double radius) {
        this.radius = radius;
    }

    public double getRadius() {
        return radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }

    public double findArea() {
        return 3.1415926*getRadius()*getRadius();
    }
}

class Cylinder {
    private double length = 1;

    public Cylinder(double length) {
        this.length = length;
    }

    public double getLength() {
        return length;
    }

    public void setLength(double length) {
        this.length = length;
    }

    public double findVolume(){
        TestCylinder c = new TestCylinder(1);
        return c.findArea()*getLength();

    }

    public static void main(String[] args) {
        Cylinder c2 = new Cylinder(1);
        System.out.println("The area of cylinder is "+ c2.findVolume());
    }

}
